<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>
<head>
	<meta name="decorator" content="moduleEdit" />
	<script type="text/javascript" src="${staticPath}/js/brand.js"></script>
	<script type="text/javascript">
		$(document).ready(function() { 
			//$("#brandCname").focus();
			$("#brandDemandForm").validate({
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			
			$("#save").click( function () {
				getPipe("#brandDemand_freshAirPipe", "#freshAirPipe0", "#freshAirPipe1", "MM*");
				getPipe("#brandDemand_exhaustAirPipe", "#exhaustAirPipe0", "#exhaustAirPipe1", "MM*");
				getPipe("#brandDemand_smokePipe", "#smokePipe0", "#smokePipe1", "MM*");
				$("#brandDemandForm").submit(); 
			});
			
			//绑定click
			//隔油池
			$("#oilStType0").click( function () 
			{ 
				typeCli("#oilStType0", "#brandDemand_oilSeparatingTank", 0);
			});

			$("#oilStType1").click( function () 
			{ 
				typeCli("#oilStType1", "#brandDemand_oilSeparatingTank", 1);
			});
			
			//空调
			$("#airConditgType0").click( function () 
			{ 
				typeCli("#airConditgType0", "#brandDemand_airConditg", 0);
			});

			$("#airConditgType1").click( function () 
			{ 
				typeCli("#airConditgType1", "#brandDemand_airConditg", 1);
			});
			
			//初始状态
			typeCli("#oilStType0", "#brandDemand_oilSeparatingTank", 0);
			typeCli("#oilStType1", "#brandDemand_oilSeparatingTank", 1);
			typeCli("#airConditgType0", "#brandDemand_airConditg", 0);
			typeCli("#airConditgType1", "#brandDemand_airConditg", 1);
			
			setPipe("#brandDemand_freshAirPipe", "#freshAirPipe0", "#freshAirPipe1", "MM*");
			setPipe("#brandDemand_exhaustAirPipe", "#exhaustAirPipe0", "#exhaustAirPipe1", "MM*");
			setPipe("#brandDemand_smokePipe", "#smokePipe0", "#smokePipe1", "MM*");
		});
		
		function typeCli(key,key1,num) 
		{ 
			if($(key).attr("checked") == "checked")
			{
				var v = $(key1);
				if(num == 0)
				{
					v.attr("disabled","disabled");
					v.val("");
				}else
				{
					v.removeAttr("disabled");
				}
			}
		}
		
		function getPipe(key,key0,key1,splitKey)
		{
			$(key).val($(key0).val()+splitKey+$(key1).val());
		}
		
		function setPipe(key,key0,key1,splitKey)
		{
			var arr = $(key).val().split(splitKey);
			$(key0).val(arr[0]);
			$(key1).val(arr[1]);
		}
		
	</script>
<style type="text/css">
h4{ border-bottom:1px dotted #ccc; padding-bottom:10px; margin:30px 0 15px; color:#b12028; font-size: 12px;}
</style>
</head>
<body>
<div class="Report_f">
           <div class="Report_f_1">
                <div class="Report_f_title_1">品牌准入</div>
                <ul class="nav nav-tabs Report_f_title_2">
                    <li><a href="#label_1" data-toggle="tab">合作需求</a></li>
                  </ul>
			<!-- Tab panes -->
			<div class="tab-content Report_f_title_3">
                  <div class="tab-pane active" id="label_1">
                         <div class="Report_f_title_4">
                         <form:form id="brandDemandForm" name="brandDemandForm"  modelAttribute="brandDemand" action="${contextPath}/biz/brand/branddemand/save" method="post" class="form-inline" role="form">
	                 		 <form:hidden path="id"/>
							<form:hidden path="brandCateId"/>
							<tags:message content="${message}"/>
                 		 	<div class="f_2">
								<div class="form-group col-sm-6">
									<label for="operateArea" class="col-sm-3 control-label f_4">经营面积(实用):</label>
									<div class="col-sm-9 f_6">
										<div class="input-group">
										  <form:input id="brandDemand_operateArea" path="operateArea" maxlength="30" class="f_5 required"/>
										  <span class="input-group-addon">㎡</span>
										</div>
									</div>
								</div>
								<div class="form-group col-sm-6">
									<label for="specialPosition" class="col-sm-3 control-label f_4">专柜位置:</label>
									<div class="col-sm-9 f_6">
										<ossp:select dictType="specialPosition" name="specialPosition" defaultSelected="${brandDemand.specialPosition}" id="brandDemand_specialPosition" class_="form-control"></ossp:select>
									</div>
								</div>
						   </div>
						   <div class="f_2">
								<div class="form-group col-sm-6">
									<label for="marketLevel" class="col-sm-3 control-label f_4">商场定位:</label>
									<div class="col-sm-9 f_6">
										  <ossp:select dictType="marketLevel" name="marketLevel" defaultSelected="${brandDemand.marketLevel }" id="brandDemand_marketLevel" class_="form-control"></ossp:select>
									</div>
								</div>
								<div class="form-group col-sm-6">
									<label for="marketType" class="col-sm-3 control-label f_4">商场业态:</label>
									<div class="col-sm-9 f_6">
										<ossp:select dictType="marketType" name="marketType" defaultSelected="${brandDemand.marketType}" id="brandDemand_marketType" class_="form-control"></ossp:select>
									</div>
								</div>
						   </div>
						   <div class="f_2">
								<div class="form-group col-sm-6">
								<label for="brandDemand_cooperationYear" class="col-sm-3 control-label f_4">合作年限:</label>
								<div class="col-sm-9 f_6">
									<div class="input-group">
									  <form:input id="brandDemand_cooperationYear" path="cooperationYear" maxlength="10" class="f_5 required"/>
									  <span class="input-group-addon">年</span>
									</div>
								</div>
								</div>
							</div>
							<h4>其它基本工程要求</h4>
							<div class="f_2">
								<div class="form-group col-sm-6">
									<label for="storeyHigh" class="col-sm-3 control-label f_4">层高要求:</label>
									<div class="col-sm-9 f_6">
									  <div class="input-group">
										 <form:input id="brandDemand_storeyHigh" path="storeyHigh" maxlength="10" class="f_5 required"/>
										  <span class="input-group-addon">MM</span>
										</div>
									</div>
								</div>
								<div class="form-group col-sm-6">
									<label for="brandDemand_drainagePipe" class="col-sm-3 control-label f_4">排水管径:</label>
									<div class="col-sm-9 f_6">
										<div class="input-group">
											<span class="input-group-addon">DN</span>
											<form:input id="brandDemand_drainagePipe" path="drainagePipe" maxlength="20" class="f_5 required"/>
										</div>
									</div>
								</div>
						   </div>
						   <div class="f_2">
								<div class="form-group col-sm-6">
									<label for="brandDemand_gas" class="col-sm-3 control-label f_4">燃气:</label>
									<div class="col-sm-9 f_6">
									  <div class="input-group">
										<form:input id="brandDemand_gas" path="gas" maxlength="10" class="f_5 required"/>
										<span class="input-group-addon">M3/H</span>
									  </div>
									</div>
								</div>
								<div class="form-group col-sm-6">
									<label for="brandDemand_waterSupplyPipe" class="col-sm-3 control-label f_4">供水管径:</label>
									<div class="col-sm-9 f_6">
										<div class="input-group">
											<span class="input-group-addon">DN</span>
											<form:input id="brandDemand_waterSupplyPipe" path="waterSupplyPipe" maxlength="20" class="f_5 required"/>
										</div>
									</div>
								</div>
						   </div>
						    <div class="f_2">
								<div class="form-group col-sm-6">
									<label for="brandDemand_supplyElectricity" class="col-sm-3 control-label f_4">供电:</label>
									<div class="col-sm-9 f_6">
									  <div class="input-group">
										 <form:input id="brandDemand_supplyElectricity"  path="supplyElectricity" maxlength="10" class="f_5 required"/>
										  <span class="input-group-addon">KW</span>
										</div>
									</div>
								</div>
								<div class="form-group col-sm-6">
									<label for="brandDemand_sewagePipe" class="col-sm-3 control-label f_4">供水管径:</label>
									<div class="col-sm-9 f_6">
										<div class="input-group">
											<span class="input-group-addon">DN</span>
											<form:input id="brandDemand_sewagePipe" path="sewagePipe" maxlength="20" class="f_5 required"/>
										</div>
									</div>
								</div>
						   </div>
						   <div class="f_3">
		                      <div class="form-group col-xs-12">
								<label for="brandDemand.freshAirPipe" class="col-lb-1 control-label f_10">新风管径:</label>
								<form:hidden id="brandDemand_freshAirPipe" path="freshAirPipe"/>
								<div class="col-sm-10 col-lb-2 f_6">
									<div class="input-group">
										<input id="freshAirPipe0" maxlength="10" class="f_5 required" />
										<span class="input-group-addon">MM*</span>
										<input id="freshAirPipe1" maxlength="10" class="f_5 required" />
										<span class="input-group-addon">MM</span>
									</div>
								</div>
							 </div>
						</div>
						<div class="f_3">
		                      <div class="form-group col-xs-12">
								<label for="exhaustAirPipe" class="col-lb-1 control-label f_10">排风管径:</label>
								<form:hidden id="exhaustAirPipe" path="exhaustAirPipe"/>
								<div class="col-sm-10 col-lb-2 f_6">
									<div class="input-group">
										<input id="smokePipe0" maxlength="10" class="f_5 required" />
										<span class="input-group-addon">MM*</span>
										<input id="smokePipe1" maxlength="10" class="f_5 required" />
										<span class="input-group-addon">MM</span>
									</div>
								</div>
							 </div>
						</div>
						<div class="f_3">
		                      <div class="form-group col-xs-12">
								<label for="brandDemand_smokePipe" class="col-lb-1 control-label f_10">排烟管径:</label>
								<form:hidden id="brandDemand_smokePipe" path="smokePipe"/>
								<div class="col-sm-10 col-lb-2 f_6">
									<div class="input-group">
										<input id="smokePipe0" maxlength="10" class="f_5 required" />
										<span class="input-group-addon">MM*</span>
										<input id="smokePipe1" maxlength="10" class="f_5 required" />
										<span class="input-group-addon">MM</span>
									</div>
								</div>
							 </div>
						</div>
						<div class="f_3">
		                      <div class="form-group col-xs-12">
								<label for="airConditgType" class="col-lb-1 control-label f_10">空调:</label>
								<div class="col-sm-10 col-lb-2 f_6">
									<div class="input-group">
										<span class="input-group-addon">
											<form:radiobutton path="airConditgType" id="airConditgType0" value="0" label="自装空调"/>
								       	 	<form:radiobutton path="airConditgType" id="airConditgType1" value="1" label="使用中央空调" />
								       </span>
										<form:input id="brandDemand_airConditg" path="airConditg" maxlength="30" class="f_5 required"/>
										<span class="input-group-addon">KW</span>
									</div>
								</div>
							 </div>
						</div>
						<div class="f_3">
		                      <div class="form-group col-xs-12">
								<label for="oilStType" class="col-lb-1 control-label f_10">隔油池:</label>
								<div class="col-sm-10 col-lb-2 f_6">
									<div class="input-group">
										<span class="input-group-addon">
								        	<form:radiobutton path="oilStType"  id="oilStType0"  value="0" label="公用隔油池" />
								        	<form:radiobutton path="oilStType" id="oilStType1" value="1" label="独立隔油池"/>
								      	</span>
										<form:input id="brandDemand_oilSeparatingTank" path="oilSeparatingTank" maxlength="30" class="f_5 required"/>
										<span class="input-group-addon">M3</span>
									</div>
								</div>
							 </div>
						</div>
						<div class="f_3">
		                      <div class="form-group col-xs-12">
								<label for="brandDemand.other" class="col-lb-1 control-label f_10">其它:</label>
								<div class="col-sm-10 col-lb-2 f_6">
									<form:textarea id="brandDemand_other" path="other" class="form-control f_11"  maxlength="300"/>
								</div>
							 </div>
						</div>
						 <div class="f_12">
						     <button type="button" class="btn btn-danger btn_5 btn_right" onclick="javascript:back('${contextPath}/biz/brand/brandmktshare/add');">返&nbsp;回</button>
						     <button type="button" id="save" class="btn btn-success btn_5 btn_right" <c:if test="${brandDemand.brandCateId == null}">disabled="disabled"</c:if> >保&nbsp;存</button>
						</div>
                 		 </form:form>
                   </div>
              </div>
		  </div>
	</div>	
</div>        
</body>
</html>